package gof_002_结构型_Structural.gof_002_适配器_Adapter.gof_001_Normal;

import java.util.UUID;

public class HttpTencentAPI {

    /**
     * 模拟 http 请求,从 Tencent 请求对象回来
     * @return
     */
    public UserTencent getUserInfoFromTencent(){
        System.out.println("从腾讯请求用户信息数据回来...");
        Utils.sleep(1);
        UserTencent userTencent = new UserTencent();

        userTencent.setTencentId(UUID.randomUUID().toString().replace("-",""));
        userTencent.setTencentUserName("");
        userTencent.setTencentSex((int)(Math.random() * 100)%2);

        return userTencent;
    }
}